import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/vue-element-admin/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

export function register(form) {
  return request({
    url: '/api/user/register/' + form.email + '/' + form.password + '/' + form.code
  })
}

export function code(form) {
  return request({
    url: '/api/code/emailcode/' + form

  })
}

export function pcode(form) {
  return request({
    url: '/api/code/phonecode/' + form

  })
}

export function pregister(form) {
  return request({
    url: '/api/user/phoneregister/' + form.phone + '/' + form.code

  })
}
